﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/UserUI/User.Master" AutoEventWireup="true" CodeBehind="SalesReturnEntry.aspx.cs" Inherits="BoutiquePOS.UI.UserUI.SalesReturnEntry" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <link href="../../Styles/UserUI/DivStyle.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/UserUI/Button.css" rel="stylesheet" type="text/css" />
    <link href="../../Styles/UserUI/style.css" rel="stylesheet" type="text/css" />
    
    <script language="javascript" type="text/javascript">
        function validation() {
            if (document.getElementById('<% =salesNoTextBox.ClientID %>').value == "") {
                document.getElementById('<%=messageResult.ClientID %>').textContent = "Sales no cannot be blank ";
                document.getElementById('<%=messageResult.ClientID%>').style.color = "red";
                document.getElementById('<% =salesNoTextBox.ClientID %>').focus();
                return false;
            }
            return true;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <fieldset>
        <legend style="color: blue">|| Sales Return Entry ||</legend>
        <div class="divRow">
            <div class="divColumn">
                <div>
                    <label>
                        Invoice No.</label></div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="text" id="salesNoTextBox" runat="server" />
                    <input type="submit" value="Search" id="searchButton" runat="server" onserverclick="SearchButton" class="myButton" />
                </div>
            </div>
            <div class="divColumn">
                <div><label>Return Date</label></div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="text" id="returnDateTextBox" runat="server" /></div>
            </div>
        </div>
    </fieldset>
    
    <fieldset>
        <div>
            <asp:GridView ID="salesReturnGridView" runat="server" 
                AutoGenerateColumns="False" CellPadding="4"
                ForeColor="#333333" Width="849px" 
                onrowcancelingedit="salesReturnGridView_RowCancelingEdit" 
                onrowediting="salesReturnGridView_RowEditing" 
                onrowupdating="salesReturnGridView_RowUpdating">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="Sales Id" Visible="False">
                       
                        <ItemTemplate>
                            <asp:Label ID="lblSalesId" runat="server" Text='<%# Bind("SalesId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Product Id" Visible="False">
                        <ItemTemplate>
                            <asp:Label ID="lblProductId" runat="server" Text='<%# Bind("AProduct.ProductId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Product Name">
                        <ItemTemplate>
                            <asp:Label ID="lblProductBrandName" runat="server" Text='<%# Bind("AProduct.ProductBrandName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sales Qty">
                        <ItemTemplate>
                            <asp:Label ID="lblSalesQty" runat="server" Text='<%# Bind("SalesQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Free Qty">
                        <ItemTemplate>
                            <asp:Label ID="lblSalesFreeQty" runat="server" Text='<%# Bind("SalesFreeQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="TP">
                        <ItemTemplate>
                            <asp:Label ID="lblTradePrice" runat="server" Text='<%# Bind("TradePrice") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="MRP">
                        <ItemTemplate>
                            <asp:Label ID="lblMRP" runat="server" Text='<%# Bind("MRP") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Total MRP">
                        <ItemTemplate>
                            <asp:Label ID="lblTotalMRM" runat="server" Text='<%# Bind("TotalMRP") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Dis. Per">
                        <ItemTemplate>
                            <asp:Label ID="lblDiscountPer" runat="server" Text='<%# Bind("DiscountPer") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Dis.Amt.">
                        <ItemTemplate>
                            <asp:Label ID="lblDiscountAmt" runat="server" Text='<%# Bind("DiscountAmt") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="RtnQty">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtReturnQty" runat="server" Text='<%# Bind("ReturnQty") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblReturnQty" runat="server" Text='<%# Bind("ReturnQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="RtnFreeQty">
                        <EditItemTemplate>
                            <asp:TextBox ID="txtFreeReturnQty" runat="server" Text='<%# Bind("ReturnFreeQty") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lblReturnFreeQty" runat="server" Text='<%# Bind("ReturnFreeQty") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:CommandField ShowEditButton="True" />
                    <asp:CommandField ShowSelectButton="True" />
                </Columns>
                <EditRowStyle BackColor="#7C6F57" />
                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#E3EAEB" />
                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F8FAFA" />
                <SortedAscendingHeaderStyle BackColor="#246B61" />
                <SortedDescendingCellStyle BackColor="#D4DFE1" />
                <SortedDescendingHeaderStyle BackColor="#15524A" />
            </asp:GridView>
        </div>
        <br />
    </fieldset>
    
    <fieldset>
        <div class="divRow">
            <div class="divColumn">
                <div>
                    <p id="messageResult" runat="server">
                    </p>
                </div>
            </div>
            <div class="divColumn">
                <div>
                    <input type="submit" value="Return" id="saveButton" runat="server" 
                        onserverclick="SaveSalesReturn" class="myButton" 
                        onclick="javascript:return validation()"/>&nbsp;
                    <input type="submit" value="Clear" id="clearButton" runat="server" onserverclick="ClearButton" class="myButton" />&nbsp;
                    <input type="submit" value="Close" id="closeButton" runat="server" onserverclick="CloseButton" class="myButton" />&nbsp;
                    <%--<input type="submit" value="Delete" id="deleteButton" runat="server" onserverclick="DeleteButton" class="myButton"/>--%>
                </div>
            </div>
            <%--3rd row close--%>
        </div>
    </fieldset>

</asp:Content>

<%--<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>--%>
